{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "193d7381",
   "metadata": {},
   "source": [
    "### 上周学习内容\n",
    "* python的第一行代码\n",
    "\n",
    "#### 重要资源：\n",
    "> [python官网](https://python.com)  \n",
    "\n",
    "> [blobs](https://cnblogs.com/xuzhichao)\n",
    "\n",
    "### 本周学习内容\n",
    "\n",
    "#### 1.python环境配置\n",
    "* A.[pycharm](https://www.jetbrains.com/pycharm/)\n",
    "> a.项目管理的IDE  \n",
    "> b.[github education pack](https://education.github.com/pack)可免费获取一年 专业版使用\n",
    "\n",
    "#### 2.项目1：奇数中选择指定时间\n",
    "\n",
    "\n",
    "#### 3.变量\n",
    "\n",
    "#### 4.if else 条件判断\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "db66f505",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Not an odd minute.\n"
     ]
    }
   ],
   "source": [
    " from datetime import datetime\n",
    " \n",
    " odds = [  1, 3,  5,  7,  9, 11,13,15,17,19\n",
    "             ,21,23,25,27,29,31,33,35,37,39\n",
    "             ,41,43,45,47,49,51,53,55,57,59]    \n",
    " \n",
    " right_this_minute = datetime.today().minute\n",
    " \n",
    " if right_this_minute in odds:\n",
    "    print(\"This minute seems a little odd.\")\n",
    "else:\n",
    "    print(\"Not an odd minute.\")\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "cb1fb1b3",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "43"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "datetime.today().minute"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "08685795",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "44"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "datetime.today().minute"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "a424bded",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Zhichao Zhichao\n",
      "What is the value of name2 now?\n"
     ]
    }
   ],
   "source": [
    "name = \"Zhichao\"\n",
    "\n",
    "name2 = name\n",
    "print(name,name2)\n",
    "\n",
    "name = \"You-gege\"\n",
    "\n",
    "print(\"What is the value of name2 now?\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "6ad13f3a",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Zhichao Zhichao\n",
      "What is the value of name2 now?\n",
      "Han-Teng Zhichao\n"
     ]
    }
   ],
   "source": [
    "name = \"Zhichao\"\n",
    "\n",
    "name2 = name\n",
    "print(name,name2)\n",
    "\n",
    "name = \"Han-Teng\"\n",
    "\n",
    "print(\"What is the value of name2 now?\")\n",
    "print(name, name2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "5f707121",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "This minute seems a little odd.\n"
     ]
    }
   ],
   "source": [
    "from datetime import datetime\n",
    "\n",
    "odds = [  1, 3,  5,  7,  9, 11,13,15,17,19\n",
    "             ,21,23,25,27,29,31,33,35,37,39\n",
    "             ,41,43,45,47,49,51,53,55,57,59]\n",
    "\n",
    "right_this_minute = datetime.today().minute\n",
    "\n",
    "if right_this_minute in odds:\n",
    "    print(\"This minute seems a little odd.\")\n",
    "else:\n",
    "    print(\"Not an odd minute.\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "39489c92",
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'today' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-12-9c4a2e374030>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[1;32mif\u001b[0m \u001b[0mtoday\u001b[0m \u001b[1;33m==\u001b[0m \u001b[1;34m\"Saturday\"\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m      2\u001b[0m     \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"Party!\"\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      3\u001b[0m \u001b[1;32melif\u001b[0m \u001b[0mtoday\u001b[0m \u001b[1;33m==\u001b[0m \u001b[1;34m\"Sunday\"\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      4\u001b[0m     \u001b[1;32mif\u001b[0m \u001b[0mcondition\u001b[0m \u001b[1;33m==\u001b[0m \u001b[1;34m\"Headache\"\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      5\u001b[0m         \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"Recover, then rest.\"\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;31mNameError\u001b[0m: name 'today' is not defined"
     ]
    }
   ],
   "source": [
    "if today == \"Saturday\":\n",
    "    print(\"Party!\")\n",
    "elif today == \"Sunday\":\n",
    "    if condition == \"Headache\":\n",
    "        print(\"Recover, then rest.\")\n",
    "    else:\n",
    "        print(\"Rest.\")\n",
    "else:\n",
    "    print(\"Work, work, work.\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "0c396024",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "datetime.today().minute"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "116ba727",
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'datetime' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-1-d5f690c7b642>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mdatetime\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mtoday\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mminute\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m: name 'datetime' is not defined"
     ]
    }
   ],
   "source": [
    "datetime.today().minute"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "1f59867f",
   "metadata": {},
   "source": [
    "### 变量"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "2d0bb4b7",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "08315d87",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
